// 挂号
function registered(name, callback) {
	console.log(name + "挂号中", currentTime());
	setTimeout(function(){
		callback(4);
	}, 2000);
}
// 看医生
function seeDoctor(name, callback) {
	console.log(name + '正在看医生', currentTime());
	setTimeout(function(){
		callback('一包板蓝根');
	}, 3000);
}
// 买药
function takeMedicine(name, callback) {
	console.log(name + "正在拿药", currentTime());
	setTimeout(function(){
		callback();
	}, 1000);
}
function currentTime() {
    return ", 时间" + new Date().getSeconds();
}
registered('小明', function(num){
	console.log('挂号成功, 号码牌:', num, currentTime());
	seeDoctor('小明', function(m) {
		console.log('医生要小明拿药: ', m, currentTime());
		takeMedicine('小明', function() {
			console.log('拿药成功，看病结束', currentTime());
		});
	});
})

